<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>CSS3写水平菜单导航</title>
		<style type="text/css">
			*{
				margin: 0;
				padding: 0;
			}
			ul{
				list-style: none;
			}
			a{
				text-decoration: none;
			}
			#nav{
				width: 500px;
				height: 40px;
				background: orange;
				margin: 20px auto;
			}
			#nav ul li{
				float: left;
				width: 100px;
				height: 40px;
				line-height: 40px;
				text-align: center;
			}
			#nav ul li a{
				display: block;
				width: 100px;
				height: 40px;
				color: white;
			}
			#nav ul li a:hover{
				background: yellowgreen;
			}
			
			/*subnav:start*/
			#nav ul li .subnav{
				width: 100px;
				position: absolute;
				_left:0px;
				_background:white;
				_filter:chroma(color=white);
				padding-top: 20px;
				display: none;
			}
			#nav ul li .subnav ul{
				background: lightpink;
			}
			#nav ul li .subnav ul li{
				float: none;/*层叠掉浮动*/
				width: 100px;
			}
			#nav ul.mian>li:hover .subnav{
				display: block;
			}
		</style>
	</head>
	<body>
		<div id="nav">
			<ul class="mian">
				<!--事件源必须是li-->
				<li>
					<a href="#">网页导航01</a>
					
					<!--子菜单-->
					<div class="subnav">
						<ul>
							<li><a href="#">子菜单01</a></li>
							<li><a href="#">子菜单02</a></li>
							<li><a href="#">子菜单03</a></li>
						</ul>
					</div>
				</li>
				<li>
					<a href="#">网页导航02</a>
					
					<!--子菜单-->
					<div class="subnav">
						<ul>
							<li><a href="#">子菜单01</a></li>
							<li><a href="#">子菜单02</a></li>
							<li><a href="#">子菜单03</a></li>
						</ul>
					</div>
				</li>
				<li>
					<a href="#">网页导航03</a>
					
					<!--子菜单-->
					<div class="subnav">
						<ul>
							<li><a href="#">子菜单01</a></li>
							<li><a href="#">子菜单02</a></li>
							<li><a href="#">子菜单03</a></li>
						</ul>
					</div>
				</li>
				<li>
					<a href="#">网页导航04</a>
					
					<!--子菜单-->
					<div class="subnav">
						<ul>
							<li><a href="#">子菜单01</a></li>
							<li><a href="#">子菜单02</a></li>
							<li><a href="#">子菜单03</a></li>
						</ul>
					</div>
				</li>
				<li>
					<a href="#">网页导航05</a>
					
					<!--子菜单-->
					<div class="subnav">
						<ul>
							<li><a href="#">子菜单01</a></li>
							<li><a href="#">子菜单02</a></li>
							<li><a href="#">子菜单03</a></li>
						</ul>
					</div>
				</li>
			</ul>
		</div>
		<div id="content">
			hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello
		</div>
	</body>
</html>
